Skip to content
This repository has been archived by the owner on Jun 24, 2022. It is now read-only.

Gradually use React hooks on the project #406

Closed
wants to merge 7 commits into from

Conversation

ebraminio
Copy link

React 16.8.0 is now released with enabled hooks and now we can use them which leads to a good cleaning up.

The final goal will be removal of all the "extends React.Component" from the project but I've sent the patch anyway after changing just two of them to get some feedback here and maybe we can merge this and gradually do the rest.

Thanks!

@ebraminio ebraminio changed the title Gradually use React hooks on Gradually use React hooks on the project Feb 6, 2019
ERROR in
/home/travis/build/wasdk/WebAssemblyStudio/src/components/Split.tsx
[tsl] ERROR in
/home/travis/build/wasdk/WebAssemblyStudio/src/components/Split.tsx(113,3)
      TS4031: Public property 'onResizerMouseMove' of exported class has
or is using private name 'MouseEvent'.
ERROR in
/home/travis/build/wasdk/WebAssemblyStudio/src/components/editor/Tabs.tsx
[tsl] ERROR in
/home/travis/build/wasdk/WebAssemblyStudio/src/components/editor/Tabs.tsx(68,3)
      TS4031: Public property 'onDoubleClick' of exported class has or
is using private name 'MouseEvent'.
ERROR in
/home/travis/build/wasdk/WebAssemblyStudio/src/components/editor/Tabs.tsx
[tsl] ERROR in
/home/travis/build/wasdk/WebAssemblyStudio/src/components/editor/Tabs.tsx(113,3)
      TS4031: Public property 'onMouseHandle' of exported class has or
is using private name 'MouseEvent'.
ERROR in
/home/travis/build/wasdk/WebAssemblyStudio/src/components/editor/Tabs.tsx
[tsl] ERROR in
/home/travis/build/wasdk/WebAssemblyStudio/src/components/editor/Tabs.tsx(118,3)
      TS4031: Public property 'onClick' of exported class has or is
using private name 'MouseEvent'.
ERROR in
/home/travis/build/wasdk/WebAssemblyStudio/src/components/editor/Tabs.tsx
[tsl] ERROR in
/home/travis/build/wasdk/WebAssemblyStudio/src/components/editor/Tabs.tsx(122,3)
      TS4031: Public property 'onDoubleClick' of exported class has or
is using private name 'MouseEvent'.
ERROR in
/home/travis/build/wasdk/WebAssemblyStudio/src/components/editor/Tabs.tsx
[tsl] ERROR in
/home/travis/build/wasdk/WebAssemblyStudio/src/components/editor/Tabs.tsx(126,3)
      TS4031: Public property 'onClose' of exported class has or is
using private name 'MouseEvent'.
src/components/Widgets.tsx Outdated Show resolved Hide resolved
src/components/Widgets.tsx Outdated Show resolved Hide resolved
src/components/Widgets.tsx Outdated Show resolved Hide resolved
@ebraminio
Copy link
Author

Enzym, that is used on the test suit, doesn't support hooks reactjs/rfcs#71 (comment) not sure how to proceed, either disabling the tests, moving away from Enzym or I don't know.

@MaxGraey
Copy link
Collaborator

MaxGraey commented Feb 6, 2019

Many things from React 16 not supported yet by enzym. See tracker: enzymejs/enzyme#1553 (comment)

@ebraminio
Copy link
Author

So WDYT about https://github.com/kentcdodds/react-testing-library maybe?

@yurydelendik
Copy link
Collaborator

Enzym, that is used on the test suit, doesn't support hooks reactjs/rfcs#71 (comment) not sure how to proceed, either disabling the tests, moving away from Enzym or I don't know.

It does not make any sense to disable testing just for new React syntax.

@ebraminio
Copy link
Author

@yurydelendik right, obviously

@ollelauribostrom
Copy link
Contributor

@ebraminio The tests depend a lot on enzyme at the moment so it would be an extensive effort to migrate to react-testing-library or react-test-renderer. However, work is done here to add hooks support to enzyme so I'll guess we just have to wait for that 🔜

@ebraminio
Copy link
Author

So let's close this, thanks :)

@ebraminio ebraminio closed this Oct 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants